import 'package:flutter/material.dart';
import 'package:flutterapp/first.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutterapp/component.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(title: 'Flutter 学习笔记', home: MyHomePage());
  }
}

class MyHomePage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => MyHomePageState();
}

class MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text("Flutter 学习 Demo"),
        ),
        body: Center(
            child: Column(
          children: <Widget>[
            MaterialButton(
              textColor: Colors.white,
              color: Colors.lightBlue,
              child: Text("初体验"),
              minWidth: double.infinity,
              onPressed: () {
                Navigator.of(context)
                    .push(MaterialPageRoute(builder: (context) => FirstPage()));
              },
            ),
            MaterialButton(
              textColor: Colors.white,
              color: Colors.lightBlue,
              child: Text("组件"),
              minWidth: double.infinity,
              onPressed: () {
                Navigator.of(context).push(
                    MaterialPageRoute(builder: (context) => ComponentPage()));
              },
            )
          ],
        )));
  }
}
